package com.example.controller.user;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.common.Result;
import com.example.entry.Notice;
import com.example.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/web/notice")
public class NoticeWebController {

    @Autowired
    private INoticeService noticeService;

    @GetMapping("/notice-info")
    public Result getNoticeInfo(){
        QueryWrapper<Notice> wrapper = new QueryWrapper<>();
        wrapper.eq("is_release", 0);
        List<Notice> list = noticeService.list(wrapper);
        return Result.success("success", list);

    }
}
